struct VOut
{
    float4 position : SV_POSITION;
    float4 color : COLOR;
	float2 TexCoord : TEXCOORD;
};

cbuffer cbPerObject
{
	float4x4 WVP;
};

Texture2D ObjTexture;
SamplerState ObjSamplerState;

VOut VShader(float4 position : POSITION, uint color : COLOR, float2 inTexCoord : TEXCOORD)
{
    VOut output;

	output.position = mul(position, WVP);

	
	output.color.g = ((color & 0x0000FF00) >> 8) / 255.0f;
	output.color.b = (color & 0x000000FF) / 255.0f;
	output.color.r = ((color & 0x00FF0000) >> 16) / 255.0f;
	output.color.a = ((color & 0xFF000000) >> 24) / 255.0f;

	
	output.TexCoord = inTexCoord;

    return output;
}












float4 PShader(VOut input) : SV_TARGET
{
	
	float4 output = ObjTexture.Sample(ObjSamplerState, input.TexCoord); //* input.color;

	return output;
}